import { reqAddressInfo, reqOrderInfo } from "@/api"
const state = {
    addressInfo: [],
    orderInfo:{}
}
const mutations = {
    ADDRESSINFO(state, addressInfo) {
        state.addressInfo = addressInfo
    },
    ORDERINFO(state,orderInfo){
        state.orderInfo = orderInfo
    }
}
const actions = {
    async addressInfo({ commit }) {
        let result = await reqAddressInfo()
        if (result.code == 200) {
            commit('ADDRESSINFO', result.data)
        }
    },
    async orderInfo({ commit }) {
        let result = await reqOrderInfo()
        console.log(result);
        if (result == 200) {
            commit('ORDERINFO',result.data)
        }
    }
}
const getters = {

}
export default {
    state,
    mutations,
    actions,
    getters
}